<?php
/**
 * Created by Sven.
 * Date: 2016/12/16
 * Time: 10:42
 * 模板初始化文件，用于初始化模板信息的文件
 */

//开始session(session前面不能有)
session_start();

// 设置编码为utf-8
header('Content-Type: text/html; charset=utf-8');

// 设置网站根目录
define('ROOT_PATH',  dirname(dirname(__FILE__))); // D:\storm\CMS

// 引入配置文件
include ROOT_PATH.'/config/profile.inc.php';

// 默认启动session(和验证码冲突)
//session_start();

//// 引入数据库连接
//include ROOT_PATH.'/includes/DB.class.php';
//// 引入工具类库
//include ROOT_PATH.'/includes/Tool.class.php';
//// 引入模板类
//require ROOT_PATH.'/includes/Templates.class.php';

// 自动引入类
function __autoload($_className){
    if (preg_match('/Action$/', $_className)){
        require ROOT_PATH.'/action/'.$_className.'.class.php';
        return;
    }
    if (preg_match('/Model$/', $_className)){
        require ROOT_PATH.'/model/'.$_className.'.class.php';
        return;
    }
    require ROOT_PATH.'/includes/'.$_className.'.class.php';
}

$_tpl = new Templates();

// 引入缓存配置(区分前台和后台)
include 'common.inc.php';

